package com.TextEditor;

import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.*;

public class TextEditor {
	
	private SpellChecker spellChecker;
	private String name;

//	@Autowired
//	public TextEditor(SpellChecker spellChecker) {
//		System.out.println("Inside TextEditor constructor.");
//		this.spellChecker = spellChecker;
//	}
	 
	 @Resource(name= "SpellChecker1")
	public void setSpellChecker(SpellChecker spellChecker) {
		System.out.println("Inside setSpellChecker.");
		this.spellChecker = spellChecker;
	}

	
	 public SpellChecker getSpellChecker(){ 
		 return spellChecker; 
	}
	 

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		System.out.println("property name - "+name);
		return name;
	}

	public void spellCheck() {
		spellChecker.checkSpelling();
	}
}